#include "quadratics-core.h"
#include "quadratics-log.h"
#include <stdio.h>

#define REQUIRED_PARAMETERS 3

int main(int argc, char *argv[]){
	Coef coef;
	Root root;	
	//double a,b,c; //coefficients defined in typedef quadratic-core.h
	FILE *fp;

	if(argc == 1){
		printf("The very simple quadratics equation solver, for Ax^2+Bx+C=0\n\n");
		toggleLog();
		printf("Please enter the values for the variables A,B, and C:\n");
		printf("A: ");
		scanf("%lf", &coef.a);
		//coef.a = checkInput();
		printf("B: ");
		scanf("%lf", &coef.b);
		//coef.b = checkInput();
		printf("C: ");
		scanf("%lf", &coef.c);
		//coef.c = checkInput();
	}

	//if(argc < REQUIRED_PARAMETERS + 1){
	//	printf("Invalid parameters, please provide three numbers\n");
	//	return 0;
	//}

	//parse arguments to doubles
	//int aCheck = sscanf(argv[1],"%lf",&coef.a);
	//int bCheck = sscanf(argv[2],"%lf",&coef.b);
	//int cCheck = sscanf(argv[3],"%lf",&coef.c);

	//make sure arguments are numbers
	//if(aCheck == 0 || bCheck == 0 || cCheck == 0){
	//	printf("All three arguments must be numbers\n");
	//	return 0;
	//}
	
	compute(&coef, &root);
	closeLog();
}
